const mongoose = require("mongoose")

const articleSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true,
    maxlength: 100, // 标题长度限制
  },
  image: {
    type: String,
    default: "https://via.placeholder.com/800x400", // 文章头图默认值
  },
  doctorName: {
    type: String,
    required: true,
  },
  doctorTitle: {
    type: String,
    required: true,
    enum: ["主任医师", "副主任医师", "主治医师", "医师"], // 限定职称选项
  },
  createdAt: {
    type: Date,
    default: Date.now,
  },
})

module.exports = mongoose.model("Article", articleSchema)
